package com.ruoyi.account.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.AccountChannelInfoHisMapper;
import com.ruoyi.db.domain.AccountChannelInfoHis;
import com.ruoyi.account.service.IAccountChannelInfoHisService;

/**
 * 渠道账户流水Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-08-28
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class AccountChannelInfoHisServiceImpl implements IAccountChannelInfoHisService 
{
    @Autowired
    private AccountChannelInfoHisMapper accountChannelInfoHisMapper;

    /**
     * 查询渠道账户流水
     * 
     * @param id 渠道账户流水主键
     * @return 渠道账户流水
     */
    @Override
    public AccountChannelInfoHis selectAccountChannelInfoHisById(Long id)
    {
        return accountChannelInfoHisMapper.selectAccountChannelInfoHisById(id);
    }

    /**
     * 查询渠道账户流水列表
     * 
     * @param accountChannelInfoHis 渠道账户流水
     * @return 渠道账户流水
     */
    @Override
    public List<AccountChannelInfoHis> selectAccountChannelInfoHisList(AccountChannelInfoHis accountChannelInfoHis)
    {
        return accountChannelInfoHisMapper.selectAccountChannelInfoHisList(accountChannelInfoHis);
    }

    /**
     * 查询渠道账户流水列表
     *
     * @param accountChannelInfoHis 渠道账户流水
     * @return 渠道账户流水
     */
    @Override
    public List<Map<String, Object>> selectAccountChannelInfoHisMapList(AccountChannelInfoHis accountChannelInfoHis)
    {
        return accountChannelInfoHisMapper.selectAccountChannelInfoHisMapList(accountChannelInfoHis);
    }

    /**
     * 新增渠道账户流水
     * 
     * @param accountChannelInfoHis 渠道账户流水
     * @return 结果
     */
    @Override
    public int insertAccountChannelInfoHis(AccountChannelInfoHis accountChannelInfoHis)
    {
        accountChannelInfoHis.setCreateTime(DateUtils.getNowDate());
        return accountChannelInfoHisMapper.insertAccountChannelInfoHis(accountChannelInfoHis);
    }

    /**
     * 修改渠道账户流水
     * 
     * @param accountChannelInfoHis 渠道账户流水
     * @return 结果
     */
    @Override
    public int updateAccountChannelInfoHis(AccountChannelInfoHis accountChannelInfoHis)
    {
        accountChannelInfoHis.setUpdateTime(DateUtils.getNowDate());
        return accountChannelInfoHisMapper.updateAccountChannelInfoHis(accountChannelInfoHis);
    }

    /**
     * 批量删除渠道账户流水
     * 
     * @param ids 需要删除的渠道账户流水主键
     * @return 结果
     */
    @Override
    public int deleteAccountChannelInfoHisByIds(Long[] ids)
    {
        return accountChannelInfoHisMapper.deleteAccountChannelInfoHisByIds(ids);
    }

    /**
     * 删除渠道账户流水信息
     * 
     * @param id 渠道账户流水主键
     * @return 结果
     */
    @Override
    public int deleteAccountChannelInfoHisById(Long id)
    {
        return accountChannelInfoHisMapper.deleteAccountChannelInfoHisById(id);
    }
}
